import { defineStore } from 'pinia';
import { store as storeName } from '/@/store';
import { LoginUserVO } from '/@/api/auth/login/types';

export const useUserStore = defineStore({
  id: 'user',
  state: (): LoinUser => {
    return {
      userId: '',
      username: '',
      realName: '',
      token: '',
      avatar: '',
      homePage: '',
      tenantId: '',
      comId: '',
      orgId: '',
      roles: [],
      auth: [],
    };
  },
  persist: true,
  getters: {},
  actions: {},
});

export function useUserStoreHook() {
  return useUserStore(storeName);
}
